<template>
    <div class="page-wrap">
        <page-title></page-title>
        <div class="page-content">
            <div class="page-row">
                <div class="box-left">
                    <role-tree @node-click="nodeClick" @updateCurrentNode="updateCurrentNode"
                        @updatePath="updatePathFun">
                    </role-tree>
                </div>
                <div class="box-right ">
                    <div class="table-box">
                        <el-tabs v-model="activeTab" class="flex-tabs">
                            <el-tab-pane label="角色成员" name="1" lazy>
                                <role-user :treeNode="treeNode"></role-user>
                            </el-tab-pane>
                            <el-tab-pane label="功能权限" name="2" lazy>
                                <func-auth :treeNode="treeNode"></func-auth>
                            </el-tab-pane>
                            <!-- <el-tab-pane label="数据权限" name="3" lazy>
                                <data-auth :treeNode="treeNode" v-if="activeTab == '3'"></data-auth>
                            </el-tab-pane> -->
                        </el-tabs>
                    </div>

                </div>
            </div>
        </div>
    </div>
</template>
<script>
    import roleTree from './roleTree';
    import roleUser from './roleUser';
    import funcAuth from './funcAuth';
    // import dataAuth from './dataAuth';
    export default {
        name: 'deptConf', // 组织机构
        components: {
            roleTree,
            roleUser,
            funcAuth,
            // dataAuth,
        },
        data() {
            return {
                activeTab: '1',
                treeNode: {},
                path: [],
            };
        },
        computed: {},
        methods: {
            nodeClick(treeNode) { // 节点点击事件
                this.treeNode = treeNode;
            },
            updateCurrentNode(node) { // 更新当前选中的节点
                this.treeNode = node;
            },
            updatePathFun(path) { // 更新面包屑导航
                this.path = path;
            },
        }
    };
</script>